package com.jmb.api.common.result;

import lombok.Getter;

/**
 * 统一返回结果状态信息类
 */
@Getter
public enum ResultCodeEnum {
    SUCCESS(200, "成功"),
    FAIL(201, "失败"),
    PARAM_ERROR(202, "参数不正确"),
    SERVICE_ERROR(203, "服务异常"),
    DATA_ERROR(204, "数据异常"),
    ILLEGAL_REQUEST(205, "非法请求"),
    REPEAT_SUBMIT(206, "重复提交"),
    DELETE_ERROR(207, "请先删除子集"),

    ADMIN_ACCOUNT_EXIST_ERROR(301, "已存在的数据"),
    ADMIN_CAPTCHA_CODE_ERROR(302, "验证码错误"),
    ADMIN_CAPTCHA_CODE_EXPIRED(303, "验证码已过期"),
    ADMIN_CAPTCHA_CODE_NOT_FOUND(304, "未输入验证码"),
    ADMIN_LOGIN_AUTH(305, "未登陆"),
    ADMIN_ACCOUNT_NOT_EXIST_ERROR(306, "账号不存在"),
    ADMIN_ACCOUNT_ERROR(307, "用户名或密码错误"),
    ADMIN_ACCOUNT_DISABLED_ERROR(308, "该用户已被禁用"),
    ADMIN_ACCESS_FORBIDDEN(309, "无访问权限"),
    ADMIN_APARTMENT_DELETE_ERROR(310, "请删除房间"),
    WEB_API_ROLE_NAME(311, "角色名称不能为空"),
    WEB_API_ROLE_NAME_EXIST(312, "角色名称已存在"),
    WEB_API_NAME(313,"名称不能为空"),
    WEB_API_PAGE(314,"分页页码数不能为空"),
    WEB_API_ID_NOT_NULL(315,"传入的Id不能为空" ),
    WEB_API_parameter(316,"参数不能为空"),
    WEB_API_PERMISSION_NAME(317,"权限名称不能为空"),
    WEB_API_PERMISSION_CODE(318,"权限编码已存在"),
    WEB_API_PARAM_VALID_ERROR(319, "参数不正确"),
    WEB_API_PROJECT_NAME(320,"项目名称不能重复"),

    WEB_API_MODULE_NAME(321,"模块名称不能重复"),
    WEB_API_TEST_CASEID(322,"用例编号已存在"),
    WEB_API_ASSERT_NAME(323, "断言名称已存在&断言编号不存在"),
    WEB_API_CACHE_NAME(324,"缓存名称不能重复"),
    WEB_API_CASEID_NOT(325,"用例数据不存在,请检查后重试" ),
    WEB_API_CACHE_DEFAULT_VALUE(326,"默认值不能为空,请检查后重试"),
    WEB_API_MODULE_NOT(327,"模块不存在" ),
    WEB_API_PROJECT_NOT(328,"项目不存在" ),
    WEB_API_PRE_CASE(329,"前置用例,不能为自身"),
    WEB_API_TEST_BODYTYPE(330,"请求bodyType参数错误"),
    WEB_API_MODULE_PROJECT(331,"项目编号和模块编号不存在" ),
    WEB_API_TEST_CASEID_NOT(332,"用例编号不存在"),


    WEB_API_TEST_RELY_NAME_NOT(333,"依赖名称不能为空"),
    WEB_API_PRE_CASE_NOW(334,"前置用例的前置用例不能为自身"),

    WEB_API_DATA_NOT_EXIST(335,"用例不存在" ),
    WEB_API_RUN_ENV(336,"运行环境错误" ),

    WEB_API_DATA_JSON_ERROR(337,"json数据解析错误"),


    WEB_API_URL_NULL(508,"URL地址不能为空，请检查后重试"),
    WEB_API_URL_PARAMS_NULL(509,"URL解析失败,参数为空"),
    WEB_API_URL_PARAMS_ERROR(510,"URL解析失败,找不到KEY"),
    WEB_API_DATA_JSON_NULL(511,"data数据和json数据为空"),
    WEB_API_HTTP_NOT(514,"不支持该http方法" ),

    BODY_TYPE_NULL_ERROR(512,"bodyType不能为空" ),
    BODY_TYPE_NOT_ERRORO(513,"不支持该body类型"),


    APP_LOGIN_AUTH(501, "未登陆"),
    APP_LOGIN_PHONE_EMPTY(502, "手机号码为空"),
    APP_LOGIN_CODE_EMPTY(503, "验证码为空"),
    APP_SEND_SMS_TOO_OFTEN(504, "验证法发送过于频繁"),
    APP_LOGIN_CODE_EXPIRED(505, "验证码已过期"),
    APP_LOGIN_CODE_ERROR(506, "验证码错误"),
    APP_ACCOUNT_DISABLED_ERROR(507, "该用户已被禁用"),




    TOKEN_EXPIRED(601, "token过期"),
    TOKEN_INVALID(602, "token非法"),
    TOKEN_EXPIRE(603, "token已失效"),

    WEB_API_PARAM_ERROR(337,"headers/params/form-data/form-data-encoded 语法错误" ),
    WEB_API_CASE_SUITE_EXIST(338,"存在测试用例，不准删除" ),
    WEB_API_CASE_SUITE_TASK_EXIST(339, "测试套件下已经存在了定时任务"),
    WEB_API_DATA_JSON_PATH_NULL(340, "json path 不能为空"),
    WEB_API_DATA_JSON_PATH_ERROR(341,"json path 语法错误，必须$.开头"),
    WEB_API_DATA_XML_PATH_NULL(342, "xml path 不能为空"),
    WEB_API_DATA_XML_PATH_ERROR(343, "xml path 语法错误，必须//开头"),
    WEB_API_RELY_NAME_EXIST(344,"依赖数据名称已存在接口依赖" ),
    WEB_API_MODIFY_NOT(355,"仅允许创建人修改" ),
    WEB_API_RELY_NOT(356,"预检接口依赖，未找到该接口依赖" ),
    WEB_API_Rely_DATA_NOT_EXIST(337,"未找到该接口依赖" ),



    WEB_API_DB_NAME_EXIST(338,"该数据源名称已存在" ),
    WEB_API_PROCESSOR_NOT_FOUND(339,"处理器未找到缓存值,请检查是否正确填写了依赖项名称" ),


    WEB_API_DEPENDENCY_INDEX_ERROR(340,"依赖项索引错误" ),
    WEB_API_DEPENDENCY_NOT_EXIST(341, "数组下标取值模式，依赖数据不存在"),
    RAW_TYPE_NOT_ERROR(342, "不支持的raw 类型"),
    WEB_API_ASSERT_NOT(345,"不支持的断言类型" ),
    WEB_API_ASSERT_Util(346,"不支持该操作符" ),
    NOT_SUPPORT_DATA_TYPE(347, "不支持该提取类型"),
    DATASOURCE_NOT(348,"未找到该数据源" ),
    DATASOURCE_Disable(349,"数据源已被禁用" ),
    WEB_API_RUN_ENV_EORROR(350, "数据源确定运行环境时出错"),
    WEB_API_DB_DISABLED(351,"数据源已被禁用" ),
    TOKEN_NOT_FOUND(352,"用户未登录" ),
    WEB_USER_NAME_NOT(323,"获取到到的username为空" ),
    WEB_USER_ID_NOT(323,"获取到到的UserId为空" ),

    WEB_API_PRE_CASE_NOT_PASS(353,"前置用例执行未通过" ),
    WEB_API_TEST_RELY_NOT_SUPPORT(354,"不支持该种取值方式" );



    private final Integer code;

    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
